package org.chupito.dao.impl;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import org.chupito.data.StokeItem;
import org.chupito.search.SearchObject;

public class StokeItemDAO extends DAOImpl<StokeItem> {

	@PersistenceContext
	private EntityManager em;

	public StokeItemDAO() {
	}
	
	public List<StokeItem> find(SearchObject search) {

		String sql = "select t from StokeItem t " + search.toWhere() ;

		TypedQuery<StokeItem> query = em.createQuery(sql, StokeItem.class);
		return query.getResultList();
	}
}
